package com.calendar.api.repository;

import com.calendar.api.model.Task;
import com.calendar.api.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;

@Repository
public interface TaskRepository extends JpaRepository<Task, Long> {
    List<Task> findByCategoryIdAndUser(String categoryId, User user);
    List<Task> findByDueDateAndUser(LocalDate dueDate, User user);
    List<Task> findByDueDateAndCategoryIdAndUser(LocalDate dueDate, String categoryId, User user);
    List<Task> findByCompletedAndUser(boolean completed, User user);
    List<Task> findByUser(User user);
} 